<template>
  <div>
    <banner :bannerImg="bannerImg"
     :sightName="sightName"
     :gallaryImgs="gallaryImgs"
     ></banner>
    <detail-header></detail-Header>
    <div class="content">
      <detail-list :list="list"></detail-list>
    </div>
  </div>
</template>

<script>
import axios from 'axios'
import banner from './component/banner'
import detailHeader from './component/header'
import detailList from './component/list'
export default {
  name: 'detail',
  components: {
    banner,
    detailHeader,
    detailList
  },
  data () {
    return {
      list: [],
      gallaryImgs: [],
      bannerImg: '',
      sightName: ''
    }
  },
  methods: {
    getData () {
      axios.get('/api/detail.json', {
        params: this.$route.params.id
      }).then(this.handelSucc)
    },
    handelSucc (res) {
      res = res.data
      if (res.ret && res.data) {
        const data = res.data
        this.list = data.categoryList
        this.gallaryImgs = data.gallaryImgs
        this.bannerImg = data.bannerImg
        this.sightName = data.sightName
      }
    }
  },
  mounted () {
    this.getData()
  }
}
</script>

<style lang="stylus" scoped>
  .content
    height: 50rem
</style>
